<!DOCTYPE html>
<html lang="en">

	<head>
		<meta charset="utf-8">
		<link rel="stylesheet" href="style/css/ch-ui.admin.css">
		<link rel="stylesheet" href="style/font/css/font-awesome.min.css">
		<link rel="stylesheet" href="style/css/page.css" />
		<script type="text/javascript" src="style/js/jquery.js"></script>
		<script type="text/javascript" src="style/js/ch-ui.admin.js"></script>
		<script type="text/javascript" src="style/js/page.js" ></script>
		<script>
			var pageSize = '';
			$(function() {
				pageSize = $("#pageSize option:selected").val();
				$("#pageSize").change(function() {
					//	alert(1);
					pageSize = $("#pageSize option:selected").val();
					console.log(pageSize);
					//var url = "http://192.168.11.130:10001/V1/app/url/allUrlState?page=1&pageSize=" + pageSize + "";
					var url = "http://112.74.51.64:20002/api/V1/app/url/allUrlState?page=1&pageSize=" + pageSize + "";
					$.ajax({
						type: "get",
						url: url,
						dataType: 'jsonp',
						processData: false,
						success: function(data) {
							var list = data.data.ArrayList;
							var test = '';
							for(var i = 0; i < list.length; i++) {
								test = test + "<tr><td class="+"tc"+">" + list[i].netUrl + "</td>";
								test = test + "<td class="+"tc"+">" + list[i].num + "</td>";
								test = test + "<td class="+"tc"+">" + list[i].avgTime + "</td>";
								test = test + "<td class="+"tc"+">" + list[i].success + "</td>";
								test = test + "<td class="+"tc"+">" + list[i].fail + "</td>";
								test = test + "<td class="+"tc"+">" + list[i].unlogin + "</td>";
								test = test + "<td class="+"tc"+"><a href=" + "webloadchartdetails.html" + ">" + "查看" + "</a></td></tr>";
								//test = '';
							}
							$(".list_tab").html(test);
						var title='';
						title = title+ "<tr><th  class="+"tc"+">"+"接口名称"+"</th>";
						title =title+  "<th class="+"tc"+">"+"调用次数"+"</th>";
						title = title+  "<th class="+"tc"+">"+"平均耗时"+"</th>";
						title = title+  "<th class="+"tc"+">"+"成功次数"+"</th>";
						title = title+  "<th class="+"tc"+">"+"失败次数"+"</th>";
						title = title+  "<th class="+"tc"+">"+"未登录次数"+"</th>";
						title = title+  "<th class="+"tc"+">"+"操作"+"</th></tr>";
					$(".list_tab").prepend(title);
						}
					});
				});

			});

			//var url = "http://192.168.11.130:10001/V1/app/url/allUrlState?page=1&pageSize=" + pageSize + "";
			var url = "http://112.74.51.64:20002/api/V1/app/url/allUrlState?page=1&pageSize=" + pageSize + "";
			$.ajax({
				type: "get",
				url: url,
				dataType: 'jsonp',
				processData: false,
				success: function(data) {
					var list = data.data.ArrayList;
					var test = '';
					for(var i = 0; i < list.length; i++) {
						test = test + "<tr><td class="+"tc"+">" + list[i].netUrl + "</td>";
						test = test + "<td class="+"tc"+">" + list[i].num + "</td>";
						test = test + "<td class="+"tc"+">" + list[i].avgTime + "</td>";
						test = test + "<td class="+"tc"+">" + list[i].success + "</td>";
						test = test + "<td class="+"tc"+">" + list[i].fail + "</td>";
						test = test + "<td class="+"tc"+">" + list[i].unlogin + "</td>";
						test = test + "<td class="+"tc"+"><a href=" + "webloadchartdetails.html?urlName=" +list[i].netUrl +">" + "查看" + "</a></td></tr>";
						$(".list_tab").html(test);
					//	test = '';
					}
						var title='';
						title = title+ "<tr><th  class="+"tc"+">"+"接口名称"+"</th>";
						title =title+  "<th class="+"tc"+">"+"调用次数"+"</th>";
						title = title+  "<th class="+"tc"+">"+"平均耗时"+"</th>";
						title = title+  "<th class="+"tc"+">"+"成功次数"+"</th>";
						title = title+  "<th class="+"tc"+">"+"失败次数"+"</th>";
						title = title+  "<th class="+"tc"+">"+"未登录次数"+"</th>";
						title = title+  "<th class="+"tc"+">"+"操作"+"</th></tr>";
					$(".list_tab").prepend(title);
				}
			});
		</script>
	</head>

	<body>
		<form action="#" method="post">
			<div class="result_wrap">
				<div class="result_content">
					<table class="list_tab">
						<!--<tr>
							<th class="tc">接口名称</th>
							<th class="tc">调用次数</th>
							<th class="tc">耗时</th>
							<th class="tc">成功次数</th>
							<th class="tc">失败次数</th>
							<th class="tc">未登录次数</th>

							<th class="tc">操作</th>
						</tr>-->
					</table>

					<div >
						<select id="pageSize" style="margin-top: 30px;">
							<option value="10">10条/页</option>
							<option value="20">20条/页</option>
							<option value="40">40条/页</option>
							<option value="60">60条/页</option>
							<option value="80">80条/页</option>
							<option value="99">99条/页</option>
						</select>
						<div class="pageList bluePageList" style="float: right;"></div>
					</div>
				</div>
			</div>
		</form>

	</body>
	
	<script>
    //分页div
    var pageDiv = $("div.pageList");
    //参数列表
    var options = {
        index: 1,//初始页码
        total:13,//总页数
        numbers:5,//显示页码数
        //...其他自定义参数
    };
    //初始化分页对象
    Page.init(pageDiv,options, function(data){
        console.info(data);
        var page=data.index;
      var  pageSize = $("#pageSize option:selected").val();
        console.log(page);
        console.log(pageSize);
      //  var url="http://192.168.11.130:10001/V1/app/url/allUrlState?page="+page+"&pageSize=" + pageSize + "";
        var url="http://112.74.51.64:20002/api/V1/app/url/allUrlState?page="+page+"&pageSize=" + pageSize + "";
        console.log(url);
        $.ajax({
       			 type: "get",
				url:url,
				dataType: 'jsonp',
				processData: false,
				success:function(data1){
					var list=data1.data.ArrayList;
					console.log(list.length);
					var test = '';
					for(var i = 0; i < list.length; i++) {
						test = test + "<tr><td class="+"tc"+">" + list[i].netUrl + "</td>";
						test = test + "<td class="+"tc"+">" + list[i].num + "</td>";
						test = test + "<td class="+"tc"+">" + list[i].avgTime + "</td>";
						test = test + "<td class="+"tc"+">" + list[i].success + "</td>";
						test = test + "<td class="+"tc"+">" + list[i].fail + "</td>";
						test = test + "<td class="+"tc"+">" + list[i].unlogin + "</td>";
						test = test + "<td class="+"tc"+"><a href=" + "webloadchartdetails.html?urlName=" +list[i].netUrl +">" + "查看" + "</a></td></tr>";
						$(".list_tab").html(test);
					//	test = '';
					}
					if(list.length!=0){
						var title='';
						title = title+ "<tr><th  class="+"tc"+">"+"接口名称"+"</th>";
						title =title+  "<th class="+"tc"+">"+"调用次数"+"</th>";
						title = title+  "<th class="+"tc"+">"+"平均耗时"+"</th>";
						title = title+  "<th class="+"tc"+">"+"成功次数"+"</th>";
						title = title+  "<th class="+"tc"+">"+"失败次数"+"</th>";
						title = title+  "<th class="+"tc"+">"+"未登录次数"+"</th>";
						title = title+  "<th class="+"tc"+">"+"操作"+"</th></tr>";
					$(".list_tab").prepend(title);
					}
				}
        });
    });

</script>

</html>